package com.videoaggre.zcl.api

import okhttp3.Interceptor
import okhttp3.Response
import java.io.IOException

/**
 * Created by zhy on 16/3/1.
 */
class HeaderInterceptor : Interceptor {
    @Throws(IOException::class)
    override fun intercept(chain: Interceptor.Chain): Response {
        val builder = chain.request().newBuilder()
        //        builder.header("RequestType", "MANAGER");
//        if (StringUtils.isNotEmpty(DataCache.UserCache.getToken())) {
//            if (BuildConfig.DEBUG) {
//                builder.header("TOKEN", "246bf1d529cd6253ac085104aa3dded5");
//            } else {
//                builder.header(Key.HEADER_TOKEN, DataCache.UserCache.getToken());
//            }
//        } else {
//            Logger.e("token为空");
//        }
//        builder.header(Key.HEADER_DEVICETYPE, App.getApp().getString(R.string.android_text));
//        builder.header(Key.HEADER_APPVERSION, App.getApp().getString(R.string.version_name));
        return chain.proceed(builder.build())
    }
}